
#include "stdafx.h"
#include "WicBitmapLock.h"

CWicBitmapLock::CWicBitmapLock()
{
    m_pIWICBitmapLock = NULL;
}

CWicBitmapLock::~CWicBitmapLock()
{
    if(m_pIWICBitmapLock)
    {
        m_pIWICBitmapLock->Release();
    }
    m_pIWICBitmapLock = NULL;
}

CWicBitmapLock::CWicBitmapLock(CWicBitmapLock const & objBitmapLock)
{
    m_pIWICBitmapLock = objBitmapLock.m_pIWICBitmapLock;
    m_pIWICBitmapLock->AddRef();
}

CWicBitmapLock& CWicBitmapLock::operator=(CWicBitmapLock const & objBitmapLock)
{
    if(m_pIWICBitmapLock)
    {
        m_pIWICBitmapLock->Release();
    }
    m_pIWICBitmapLock = objBitmapLock.m_pIWICBitmapLock;
    m_pIWICBitmapLock->AddRef();
    return *this;
}
